/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author 王宇
* @date 2023-09-26
**/
@Entity
@Data
@Table(name="course_info")
public class CourseInfo implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "course_id")
    @ApiModelProperty(value = "主键id")
    private Long courseId;

    @Column(name = "course_no",unique = true)
    @ApiModelProperty(value = "课程编码")
    private String courseNo;

    @Column(name = "course_name")
    @ApiModelProperty(value = "名称")
    private String courseName;

    @Column(name = "sell_price")
    @ApiModelProperty(value = "价格")
    private BigDecimal sellPrice;

    @Column(name = "discount_price")
    @ApiModelProperty(value = "优惠价")
    private BigDecimal discountPrice;

    @Column(name = "course_logo")
    @ApiModelProperty(value = "图标")
    private String courseLogo;

    @Column(name = "course_banner")
    @ApiModelProperty(value = "横幅图")
    private String courseBanner;

    @Column(name = "type_id")
    @ApiModelProperty(value = "分类ID")
    private Long typeId;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "createby")
    @ApiModelProperty(value = "创建人")
    private String createby;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    @Column(name = "updateby")
    @ApiModelProperty(value = "更新人")
    private String updateby;

    @Column(name = "category")
    @ApiModelProperty(value = "课程类别；视频/音频/文字")
    private Integer category;

    @Column(name = "course_info")
    @ApiModelProperty(value = "详细介绍")
    private String courseInfo;

    @Column(name = "show_index")
    @ApiModelProperty(value = "是否展示在首页0：不展示，1：展示")
    private Integer showIndex;

    @Column(name = "open_time")
    @ApiModelProperty(value = "开班时间")
    private Timestamp openTime;

    @Column(name = "platform")
    @ApiModelProperty(value = "类型，0：线上，1：线下")
    private Integer platform;

    @Column(name = "sort_index")
    @ApiModelProperty(value = "排序索引")
    private Integer sortIndex;

    @Column(name = "show_discount")
    @ApiModelProperty(value = "优惠价启停，0：停止，1：开启")
    private Integer showDiscount;

    @Column(name = "status")
    @ApiModelProperty(value = "状态，0下架，1：上架")
    private Integer status;

    @Column(name = "show_excellent")
    @ApiModelProperty(value = "显示优秀，0：不展示，1：展示")
    private Integer showExcellent;

    @Column(name = "sub_title")
    @ApiModelProperty(value = "子标题")
    private String subTitle;

    @Column(name = "applicants")
    @ApiModelProperty(value = "是否需要报名")
    private Integer applicants;

    @Column(name = "signin_pic")
    @ApiModelProperty(value = "签到图片")
    private String signinPic;

    @Column(name = "course_location")
    @ApiModelProperty(value = "课程地点")
    private String courseLocation;

    @ApiModelProperty(value = "是否展示价格，0：不展示，1：展示")
    @Column(name = "show_price")
    private Integer showPrice;

    @ApiModelProperty(value = "是否开放购买，0：不开放，1：开放")
    @Column(name = "open_buy")
    private Integer openBuy;
    public void copy(CourseInfo source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}